﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ECS.DAL.Entity
{
    public enum OBJECT_STATE
    {
        None,
        Insert,
        Update,
        Delete,

    }

    public class ObjectContext
    {
        #region private properties
        

        protected OBJECT_STATE _objectState = OBJECT_STATE.Insert;
        #endregion

        #region public properties

        public OBJECT_STATE ObjectStatus
        {
            set { _objectState = value; }
            get { return _objectState; }
        }
        #endregion
        #region constructor
        public ObjectContext()
        { 
            
        }
        #endregion
        #region public methods
        public void AddObject()
        {
            if (_objectState == OBJECT_STATE.None)
            {
                _objectState = OBJECT_STATE.Insert;
            }
        }
        public void DeleteObject()
        {
            _objectState = OBJECT_STATE.Delete;
        }
        public void UpdateObject()
        {
            if (_objectState == OBJECT_STATE.None)
            {
                _objectState = OBJECT_STATE.Update;
            }
        }
        public void NotChangeObject()
        {
            _objectState = OBJECT_STATE.None;
        }
        public OBJECT_STATE GetObjectSate()
        {
            return _objectState;
        }
        #endregion
    }
}
